importPackage( Packages.java.awt);

/*** Variables available ************************
  step - current frame number
  casualties - List of Soldiers
  canvas - The JFrame that we are painting in
  g2 - java.awt.Graphics2D object we paint with
*************************************************/

if(step >= (5 * FPS)){
  step = 0;
}


/*for(var i=0; i<= canvas.getWidth(); i++){
  for( var j=0; j <= canvas.getHeight(); j++){
    if( i % 10 == 0 && j % 10 == 0){
//      g2.setColor( new Color(0.5, 0.3, 0.7, 0.5));
//      g2.drawLine(i, j, i + step, j + 8);
    }
  }
}*/
g2.setPaint( new java.awt.GradientPaint(0, -100, Color.GRAY, 0, canvas.getHeight() + 100, Color.BLACK));
g2.fillRect( 0, 0, canvas.getWidth(), canvas.getHeight());

var sceneLength = FPS * 5;
g2.setColor(Color.WHITE);
g2.drawRect(10, 10, sceneLength, 20);
g2.setColor(Color.GRAY);;
g2.fillRect(12, 12, step, 18);

g2.setColor(Color.WHITE);
g2.drawString(Math.round(step / 60) + " secs", canvas.getWidth() - 130, 50);
              
g2.setColor( Color.GRAY );
g2.drawString(FPS, 100, 100);